package tk.mybatis.mapper.common.example.oper;

import java.util.Map;

import org.apache.ibatis.type.JdbcType;

/**
 * 
 * title: EqualsOper.java 
 * 相等
 * @author rplees
 * @email rplees.i.ly@gmail.com
 * @version 1.0  
 * @created Jul 6, 2016 10:11:53 AM
 */
public class EqualsOper extends Oper {
	public EqualsOper(String property, Object value, Map<String, String> propertyMap) {
		if(! propertyMap.containsKey(property)) {
			throw new RuntimeException("当前实体类不包含名为" + property + "的属性!");
		}
		
		this.column = propertyMap.get(property);
		if(value instanceof Number) {
			jdbcType = JdbcType.NUMERIC.name();
		} else {
			jdbcType = JdbcType.VARCHAR.name();
		}
		this.condition = value;
	}
}